$(function(){

    var indexBanner = new Swiper('#index_banner .swiper-container', {
      slidesPerView: 2,
      spaceBetween: 30,
      centeredSlides: true,
      loop: true,
      pagination : '.swiper-pagination',
      prevButton:'.swiper-button-prev',
      nextButton:'.swiper-button-next',
    });

    var yishuSwiper = new Swiper('#yishu_swiper .swiper-container', {
      loop: true,
      pagination : '.swiper-pagination1',
    });

    var mySwiper = new Swiper('#home_huace',{
        slidesPerColumn : 2,
        slidesPerView: 5,
        slidesPerColumnFill : 'row',
        spaceBetween: 13,
        prevButton:'.shipin_left',
        nextButton:'.shipin_right',
    })

    var mySwiper = new Swiper('#picture_huace',{
        slidesPerColumn : 4,
        slidesPerView: 5,
        slidesPerColumnFill : 'row',
        spaceBetween: 13,
        prevButton:'.shipin_left',
        nextButton:'.shipin_right',
    })

    var mySwiper = new Swiper('.hezuo_list',{
        slidesPerView: 6,
        spaceBetween: 30,
        loop: true,
        prevButton:'.hezuo_left',
        nextButton:'.hezuo_right',
    })

    // 电子画册banner
    var yishuSwiper = new Swiper('#pic_banner .swiper-container', {
      loop: true,
      pagination : '.swiper-pagination',
      prevButton:'.swiper-button-prev',
      nextButton:'.swiper-button-next',
    });
  
    //选项卡
    $('.tabBtn').click(function(){
        var index=$(this).index();
        $(this).addClass('curr').siblings('.tabBtn').removeClass('curr');
        $(this).parents('.tabParent').children('.tabBox').children('.tabControl').css('display','none').eq(index).css('display','block');
    });

    //返回顶部
    $('.scrollTop').click(function(){
        var tops=$(document).scrollTop();
        var t=setInterval(function(){
            tops-=100;
            $(document).scrollTop(tops);
            if(tops<=0){
                $(document).scrollTop(0);
                clearInterval(t);
            }
        },10)
    });

    $(window).scroll(function(){
        if($(document).scrollTop() >= 44){
            $('.index_header').css('position', 'fixed');
        }else{
            $('.index_header').css('position', 'relative');
        }

        var winH = $(window).height();
        $('#content').css('min-height', winH - 134 - 60)
    })
    $(window).scroll();

    var $container = $('#masonry');
    if($container.length > 0){
        $container.imagesLoaded(function() {
            $container.masonry({
                itemSelector: '.masonry-item',
                gutter: 0,
                isAnimated: true,
            });
        });
    }
});
